Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The docs (here) imply that the matrix returned by
matrix
is column major. However, this is not what is actually happening. (example file attached).Example:
as such, this matrix does not satisfy the conditions gromacs requires.
Just transposing the matrix would be easy to solve as
Matrix(transpose(Chemfiles.matrix(...)))
. However, I'm not sure if it makes the definition inconsistent with the return of the unit cell in terms of lengths and angles. For instance, in this trajectory, we get:But if we tranpose the matrix, we do not recover these angles and lengths:
The simplest alternative would be to fix the docs and indicate that the matrix is row-major. That is somewhat inconsistent with Julia, but then at least it lets to the user the decision to transpose the matrix and arch with the consequences.
The other alternative is to check if this PR is fine, I have only transposed the matrix back and forth when converting it from the UnitCell.
traj_comp.xtc.zip